<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>习惯库 - 习惯掌控</title>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
        }
        body {
            background-color: #f6f8fa;
            color: #333;
        }
        .container {
            max-width: 414px;
            margin: 0 auto;
            background-color: white;
            min-height: 100vh;
            position: relative;
            box-shadow: 0 0 10px rgba(0,0,0,0.1);
        }
        .header {
            padding: 50px 20px 20px;
            background-color: #4CAF50;
            color: white;
        }
        .title {
            font-size: 24px;
            font-weight: bold;
        }
        .search-bar {
            padding: 15px;
            background-color: white;
            display: flex;
            align-items: center;
            border-bottom: 1px solid #eee;
            box-shadow: 0 2px 10px rgba(0,0,0,0.05);
        }
        .search-input {
            flex: 1;
            background-color: #f2f2f2;
            border: none;
            border-radius: 20px;
            padding: 10px 15px;
            font-size: 15px;
            outline: none;
        }
        .search-icon {
            color: #999;
            padding: 0 15px 0 5px;
        }
        .tabs {
            display: flex;
            padding: 0 15px;
            background-color: white;
            overflow-x: auto;
            white-space: nowrap;
            -webkit-overflow-scrolling: touch;
            scrollbar-width: none;
            border-bottom: 1px solid #eee;
        }
        .tabs::-webkit-scrollbar {
            display: none;
        }
        .tab {
            padding: 15px;
            color: #666;
            font-weight: 500;
            position: relative;
        }
        .tab.active {
            color: #4CAF50;
        }
        .tab.active:after {
            content: '';
            position: absolute;
            bottom: 0;
            left: 0;
            right: 0;
            height: 3px;
            background-color: #4CAF50;
            border-radius: 3px 3px 0 0;
        }
        .library-container {
            padding: 20px;
        }
        .section-title {
            font-size: 18px;
            font-weight: bold;
            margin-bottom: 15px;
        }
        .theory-card {
            background-color: #f1f8e9;
            border-radius: 10px;
            padding: 20px;
            margin-bottom: 20px;
            border-left: 4px solid #4CAF50;
        }
        .theory-title {
            font-size: 16px;
            font-weight: bold;
            color: #2E7D32;
            margin-bottom: 10px;
        }
        .theory-text {
            font-size: 14px;
            line-height: 1.5;
            color: #333;
            margin-bottom: 15px;
        }
        .habit-cards {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 15px;
            margin-bottom: 20px;
        }
        .habit-card {
            background-color: white;
            border-radius: 10px;
            box-shadow: 0 2px 8px rgba(0,0,0,0.08);
            padding: 15px;
            display: flex;
            flex-direction: column;
        }
        .habit-card-icon {
            width: 40px;
            height: 40px;
            background-color: #e8f5e9;
            color: #4CAF50;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 18px;
            margin-bottom: 10px;
        }
        .habit-card-title {
            font-weight: bold;
            font-size: 15px;
            margin-bottom: 5px;
        }
        .habit-card-desc {
            font-size: 12px;
            color: #666;
            margin-bottom: 10px;
            flex: 1;
        }
        .habit-card-users {
            font-size: 12px;
            color: #4CAF50;
            display: flex;
            align-items: center;
        }
        .habit-card-users i {
            margin-right: 5px;
        }
        .habit-card-button {
            margin-top: 10px;
            background-color: #4CAF50;
            color: white;
            border: none;
            border-radius: 5px;
            padding: 8px 0;
            text-align: center;
            font-weight: bold;
            font-size: 12px;
        }
        .custom-habits {
            margin-top: 20px;
        }
        .habit-list {
            background-color: white;
            border-radius: 10px;
            box-shadow: 0 2px 8px rgba(0,0,0,0.08);
            overflow: hidden;
            margin-bottom: 20px;
        }
        .habit-item {
            display: flex;
            align-items: center;
            padding: 15px;
            border-bottom: 1px solid #f5f5f5;
        }
        .habit-item:last-child {
            border-bottom: none;
        }
        .habit-icon {
            width: 40px;
            height: 40px;
            background-color: #e8f5e9;
            color: #4CAF50;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 18px;
            margin-right: 15px;
        }
        .habit-info {
            flex: 1;
        }
        .habit-title {
            font-weight: bold;
            font-size: 15px;
            margin-bottom: 5px;
        }
        .habit-desc {
            font-size: 12px;
            color: #666;
        }
        .habit-action {
            color: #4CAF50;
            font-size: 14px;
            font-weight: bold;
        }
        .habit-detail {
            margin-top: 20px;
            background-color: white;
            border-radius: 10px;
            box-shadow: 0 2px 8px rgba(0,0,0,0.08);
            padding: 20px;
        }
        .detail-header {
            display: flex;
            align-items: center;
            margin-bottom: 15px;
        }
        .detail-icon {
            width: 50px;
            height: 50px;
            background-color: #e8f5e9;
            color: #4CAF50;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 20px;
            margin-right: 15px;
        }
        .detail-title {
            flex: 1;
            font-weight: bold;
            font-size: 18px;
        }
        .detail-users {
            font-size: 14px;
            color: #4CAF50;
        }
        .detail-section {
            margin-bottom: 20px;
        }
        .detail-section-title {
            font-weight: bold;
            margin-bottom: 10px;
            color: #4CAF50;
        }
        .detail-text {
            font-size: 14px;
            line-height: 1.5;
            color: #333;
        }
        .tips-list {
            margin-top: 10px;
        }
        .tip-item {
            display: flex;
            margin-bottom: 10px;
        }
        .tip-number {
            width: 25px;
            height: 25px;
            background-color: #4CAF50;
            color: white;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 12px;
            margin-right: 10px;
            flex-shrink: 0;
        }
        .tip-text {
            font-size: 14px;
            line-height: 1.5;
        }
        .add-button {
            margin-top: 20px;
            background-color: #4CAF50;
            color: white;
            border: none;
            border-radius: 8px;
            padding: 15px 0;
            text-align: center;
            font-weight: bold;
            font-size: 16px;
            width: 100%;
        }
        .navigation {
            position: fixed;
            bottom: 0;
            width: 100%;
            max-width: 414px;
            background-color: white;
            display: flex;
            justify-content: space-around;
            padding: 15px 0;
            border-top: 1px solid #e0e0e0;
        }
        .nav-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            font-size: 12px;
            color: #888;
        }
        .nav-item.active {
            color: #4CAF50;
        }
        .nav-icon {
            font-size: 20px;
            margin-bottom: 5px;
        }
        .empty-space {
            height: 80px;
        }
    </style>
</head>
<body>
    <div class="container">
        <div class="header">
            <div class="title">习惯库</div>
        </div>
        
        <div class="search-bar">
            <input type="text" placeholder="搜索习惯" class="search-input">
            <div class="search-icon">
                <i class="fas fa-search"></i>
            </div>
        </div>
        
        <div class="tabs">
            <div class="tab active">推荐</div>
            <div class="tab">健康</div>
            <div class="tab">学习</div>
            <div class="tab">工作</div>
            <div class="tab">生活</div>
            <div class="tab">关系</div>
            <div class="tab">冥想</div>
            <div class="tab">理财</div>
        </div>
        
        <div class="library-container">
            <div class="theory-card">
                <div class="theory-title">习惯四法则</div>
                <div class="theory-text">詹姆斯·克利尔在《掌控习惯》中提出了习惯形成的四个步骤：明显的提示、强烈的渴望、简单的行动和即时的奖励。这四个步骤构成了习惯形成的基础。</div>
                <div class="habit-card-button">查看详情</div>
            </div>
            
            <div class="section-title">推荐习惯</div>
            <div class="habit-cards">
                <div class="habit-card">
                    <div class="habit-card-icon">
                        <i class="fas fa-running"></i>
                    </div>
                    <div class="habit-card-title">晨跑5公里</div>
                    <div class="habit-card-desc">清晨跑步能提高新陈代谢，增强体能，提升一天的精力水平。</div>
                    <div class="habit-card-users">
                        <i class="fas fa-users"></i> 12,354人已添加
                    </div>
                    <div class="habit-card-button">添加习惯</div>
                </div>
                
                <div class="habit-card">
                    <div class="habit-card-icon">
                        <i class="fas fa-book"></i>
                    </div>
                    <div class="habit-card-title">每日阅读30分钟</div>
                    <div class="habit-card-desc">每天阅读能扩展知识，提高思维能力，是最有价值的习惯之一。</div>
                    <div class="habit-card-users">
                        <i class="fas fa-users"></i> 18,732人已添加
                    </div>
                    <div class="habit-card-button">添加习惯</div>
                </div>
                
                <div class="habit-card">
                    <div class="habit-card-icon">
                        <i class="fas fa-water"></i>
                    </div>
                    <div class="habit-card-title">喝水2000ml</div>
                    <div class="habit-card-desc">充足的水分摄入对身体的各项功能都至关重要，提高集中力和精力。</div>
                    <div class="habit-card-users">
                        <i class="fas fa-users"></i> 24,123人已添加
                    </div>
                    <div class="habit-card-button">添加习惯</div>
                </div>
                
                <div class="habit-card">
                    <div class="habit-card-icon">
                        <i class="fas fa-bed"></i>
                    </div>
                    <div class="habit-card-title">晚上10:30睡觉</div>
                    <div class="habit-card-desc">规律的睡眠能提高免疫力，改善记忆力，促进身体恢复。</div>
                    <div class="habit-card-users">
                        <i class="fas fa-users"></i> 9,845人已添加
                    </div>
                    <div class="habit-card-button">添加习惯</div>
                </div>
            </div>
            
            <div class="habit-detail">
                <div class="detail-header">
                    <div class="detail-icon">
                        <i class="fas fa-spa"></i>
                    </div>
                    <div class="detail-title">每日冥想</div>
                    <div class="detail-users">15,426人已添加</div>
                </div>
                
                <div class="detail-section">
                    <div class="detail-section-title">习惯描述</div>
                    <div class="detail-text">冥想是科学证实的减压方法，能提高专注力，改善情绪状态，增强自我意识。每天只需10-15分钟，就能带来长期的心理和生理益处。</div>
                </div>
                
                <div class="detail-section">
                    <div class="detail-section-title">四步习惯养成法</div>
                    <div class="tips-list">
                        <div class="tip-item">
                            <div class="tip-number">1</div>
                            <div class="tip-text"><strong>明显的提示：</strong>在固定时间（如早上起床后）、固定地点（在客厅或卧室）进行冥想，或配合其他已有习惯之后（如喝完晨间咖啡后）。</div>
                        </div>
                        <div class="tip-item">
                            <div class="tip-number">2</div>
                            <div class="tip-text"><strong>强烈的渴望：</strong>想象冥想带给你的平静感受，以及提高工作效率和减少焦虑的长期好处。</div>
                        </div>
                        <div class="tip-item">
                            <div class="tip-number">3</div>
                            <div class="tip-text"><strong>简单的行动：</strong>开始时只冥想2分钟，逐渐增加到10-15分钟。准备舒适的坐垫和安静的环境，或使用引导冥想应用。</div>
                        </div>
                        <div class="tip-item">
                            <div class="tip-number">4</div>
                            <div class="tip-text"><strong>即时的奖励：</strong>冥想后记录自己的平静感受，或奖励自己喜欢的健康饮品。在应用中查看连续坚持天数的成就。</div>
                        </div>
                    </div>
                </div>
                
                <button class="add-button">添加到我的习惯</button>
            </div>
            
            <div class="empty-space"></div>
        </div>
        
        <div class="navigation">
            <div class="nav-item">
                <div class="nav-icon"><i class="fas fa-home"></i></div>
                <div>首页</div>
            </div>
            <div class="nav-item">
                <div class="nav-icon"><i class="fas fa-list-check"></i></div>
                <div>习惯</div>
            </div>
            <div class="nav-item">
                <div class="nav-icon"><i class="fas fa-chart-line"></i></div>
                <div>统计</div>
            </div>
            <div class="nav-item">
                <div class="nav-icon"><i class="fas fa-users"></i></div>
                <div>社区</div>
            </div>
            <div class="nav-item active">
                <div class="nav-icon"><i class="fas fa-user"></i></div>
                <div>我的</div>
            </div>
        </div>
    </div>
</body>
</html>
